package com.travel.service.impl;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.travel.base.BaseDao;
import com.travel.base.impl.BaseServiceImpl;
import com.travel.bean.User;
import com.travel.dao.UserDao;
import com.travel.service.UserService;
import com.travel.utils.PageHelper;

@Service("userServiceImpl")
public class UserServiceImpl extends BaseServiceImpl<User> implements UserService {
	@Resource(name="userDaoImpl")
	private UserDao userDao;
	
	@Override
	public BaseDao<User> getBaseDao() {
		// TODO Auto-generated method stub
		return this.userDao;
	}

	@Override
	public PageHelper getUserByMap(Map map, Integer pageNum, Integer pageSize) {
		// TODO Auto-generated method stub
		PageHelper page=new PageHelper();
		page.setCurrentPageNo(pageNum);
		page.setPageSize(pageSize);
		page.setTotalCount(userDao.getUserCountByMap(map));
		page.setList(userDao.getUserByMap(map, pageNum, pageSize));
		return page;
	}



	

}
